<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增员工')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-edit">
        <div class="form-group">
            <label class="col-sm-3 control-label ">项目编号：</label>
            <div class="col-sm-8">
                <input class="form-control" th:field="*{einemanagement.jspmNo}" type="text" name="jspmNo" id="jspmNo" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">年：</label>
            <div class="col-sm-8">
                <input class="form-control"th:field="*{einemanagement.year}" type="text" name="year" id="year" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">月：</label>
            <div class="col-sm-8">
                <input class="form-control"th:field="*{einemanagement.month}" type="text" name="month" id="month" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">事件类型：</label>
            <div class="col-sm-8">
                <input class="form-control"th:field="*{einemanagement.eventType}" type="text" name="eventType" id="eventType" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">事件级别：</label>
            <div class="col-sm-8">
                <input class="form-control"th:field="*{einemanagement.eventLevel}" type="text" name="eventLevel" id="eventLevel" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">备注：</label>
            <div class="col-sm-8">
                <input class="form-control"th:field="*{einemanagement.remarks}" type="text" name="remarks" id="remarks" required>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer"/>
<script type="text/javascript">
    function submitHandler() {
        if ($.validate.form()) {
            edit();
        }
    }

    function edit() {
        var compID = $("input[name='compID']").val();
        var compCode = $("input[name='compCode']").val();
        var title = $("input[name='title']").val();
        $.ajax({
            cache: true,
            type: "POST",
            url: ctx + "jpbi/comp/edit",
            data: {
                "compID": compID,
                "title": title,
                "compCode": compCode
            },
            async: false,
            error: function (request) {
                $.modal.alertError("系统错误");
            },
            success: function (data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>

</body>
</html>
